<template>
    <el-table-column
        :type="type" 
        :label="label" 
        :class-name="className" 
        :label-class-name="labelClassName"
        :property="property"
        :prop="prop"
        :width="width"
        :min-width="minWidth"
        :render-header="renderHeader"
        :sortable="sortable"
        :sort-method="sortMethod"
        :sort-by="sortBy"
        :resizable="resizable"
        :context="context"
        :column-key="columnKey"
        :align="align"
        :header-align="headerAlign"
        :show-tooltip-when-overflow="showTooltipWhenOverflow"
        :show-overflow-tooltip="showOverflowTooltip"
        :fixed="fixed"
        :selectable="selectable"
        :reserve-selection="reserveSelection"
        :filter-method="filterMethod"
        :filtered-value="filteredValue"
        :filter-multiple="filterMultiple"
        :index="index"
        :sort-orders="sortOrders">
          <template slot-scope="scope" >
              <slot :row="scope.row" v-if="$scopedSlots.default?$scopedSlots.default:$slots.default"></slot>
              <dx-text v-else :code-type="codeType" :value="scope.row[prop]" :multiable="multiable" :ctrlName="ctrlName" :condition="condition" :formatter="formatter"></dx-text>
          </template>
        </el-table-column>
</template>

<script>
import DxText from './dx-text'
import {codeProvider} from '../../../assets/js/provider.js'
export default {
    components : {
      DxText
    },
    props: {
    type: {
      type: String,
      default: 'default'
    },
    label: String,
    className: String,
    labelClassName: String,
    property: String,
    prop: String,
    width: {},
    minWidth: {},
    renderHeader: Function,
    sortable: {
      type: [String, Boolean],
      default: false
    },
    sortMethod: Function,
    sortBy: [String, Function, Array],
    resizable: {
      type: Boolean,
      default: true
    },
    context: {},
    columnKey: String,
    align: String,
    headerAlign: String,
    showTooltipWhenOverflow: Boolean,
    showOverflowTooltip: Boolean,
    fixed: [Boolean, String],
    formatter: Function,
    selectable: Function,
    reserveSelection: Boolean,
    filterMethod: Function,
    filteredValue: Array,
    filters: Array,
    filterPlacement: String,
    filterMultiple: {
      type: Boolean,
      default: true
    },
    index: [Number, Function],
    sortOrders: {
      type: Array,
      default() {
        return ['ascending', 'descending', null];
      },
      validator(val) {
        return val.every(order => ['ascending', 'descending', null].indexOf(order) > -1);
      }
    },
    //
    codeType : String,
    condition : Object,
    multiable : {type:Boolean,default : false},
    ctrlName : {type:String,default:'text'},
  },
  data(){
      return {
          codeTypeMap : {}

      }
  },
  methods : {

     
  },
  created(){

  },
  mounted(){

  }
}
</script>
